import{m as g,U as _,j as c,s as m,p as k,h,d as S,M as v,c as y,o as $,w as d,a as s,t as l,f as x,u as C,g as I,n as U,i as D}from"./DrFvzlh8agutd.js";import{K as N}from"./MpnPZlTSagutd.js";import{i as V,w as u}from"./WInZ5KVARz5uC.js";import{u as b}from"./CNvcbrnqc68oV.js";import{_ as B}from"./BF-9IbgxcrTPo.js";import{_ as E}from"./BfQegiIr3PfrX1.js";import{_ as L}from"./DE1J_9T34aEgas.js";import"./DZFz6IIX1esOcA.js";import"./sf48gIWk3aD96J.js";import"./JLTbM6jQPQMM7.js";import"./2AZ41aXe85ygF.js";import"./Nc0jDSlw1t8dnT.js";/* empty css              */const w=k("rt:import-storage");async function T(t){await g(500);const o=_(),{open:i,dispose:a}=b(B);o.add(a);const r=V(t);o.add(r);let e;for(;!await r.unlock(e);){const p=await i({title:c("settings.storage.passwordTitle"),intro:c("settings.storage.passwordIntro"),outro:c("settings.storage.passwordOutro"),requiresConfirm:!1});if(!p){await o();return}e=p}const f=await r.getStatus();await o();const n=f?.id;n&&(m.workspaces?.[n]!=null?(w("Add external storage"),await u.openWorkspace(n),await m.workspace?.sync?.registerExternalStorage(t,{password:e})):(w("Load from storage"),await u.openWorkspaceViaExternalStorage(t,{password:e}))),await h.workspaceNoHistory()}const M={class:"_center"},Q=S({__name:"app-page-error",setup(t){const o=v();function i(){const a=U?D.productionUrl:location.href;T({type:"service",externalStorageId:N(),workspaceId:o?.params?.workspaceId,serviceUrl:new URL("/api/v1/workspaces/",a).href})}return(a,r)=>($(),y(L,null,{default:d(()=>[s("div",M,[s("h1",null,l(a.$t("error.title")),1),s("p",null,l(a.$t("error.message")),1),s("p",null,[x(C(E),{onClick:i},{default:d(()=>[I(l(a.$t("error.button")),1)]),_:1})])])]),_:1}))}});export{Q as default};